package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {

    /**
     * 根据菜品id查询对应的套餐id
     * @param ids
     * @return
     */
    List<Long> getSetmealIdsByDishIds(@Param("dishIds")List<Long> ids);

    /**
     * 根据套餐id获取到信息
     * @param setmealId
     * @return
     */
    @Select("select * from sky_take_out.setmeal_dish where setmeal_id=#{setmealId} ")
    List<SetmealDish> getBySetmealID(Long setmealId);

    /**
     * 根据列表信息来保存内容
     * @param setmealDish
     */
    void save(List<SetmealDish> setmealDish);

    /**
     * 批量删除
     * @param ids
     */
    void deleteBatch(List<Long> ids);
}
